Peer-to-peer networks have recently attracted increased attention in both academia and business. Peer-to-peer networks offer many desirable features, such as adaptation, self-organization, load-balancing, fault-tolerance, low cost, high availability, scalability, and may be configured to provide a large pool of resources. Peer-to-peer networks have emerged as a popular way to share large amounts of data, such as by peers downloading songs that are referenced as being available for download through a peer-to-peer website.
When providing resources for use by multiple clients, situations may be encountered in which two or more clients desire access to a particular resource, which may be referred to as a “collision”. Mutual exclusion techniques refer to techniques that may be used to share resources such that the different clients that desire access to the particular resource do not conflict and cause unwanted interactions. By using mutual exclusion techniques, clients may obtain “rights” to access the resource as specified by the particular mutual exclusion technique employed.
An example of a mutual exclusion technique involves the use of semaphores. Semaphores are values that each client can check and then change. Depending on the value that is found, the client can use the resource or will find that it is already in use and try again. Typically, a client using semaphores checks the value and then, if no other client is using the resource, changes the value to reflect that the resource is being used by the client such that subsequent clients will “know” that the particular resource is in use. Thus, semaphores provide a technique for coordinating and synchronizing activities in which multiple clients compete for the same resource, such as to share access to a particular file.
In the previous mutual exclusion techniques, however, problems caused by collisions between clients that desired use the particular resource were magnified by the “greedy” behavior of the clients. For example, a plurality of clients may desire access to a resource, with only one of the clients “winning” the rights to access the resource through use of a mutual exclusion technique. The “losing” client that did not obtain rights to access the resource, however, retried to gain rights by continually resending requests. The repeated resending of the requests consumed hardware and software resources of the peer providing the resource and the client trying to obtain access to the resource. Repeated resending also consumes network bandwidth between the client and the peer. This problem was further magnified as the numbers of clients that also desired access to the resource increased, thereby resulting in even greater inefficiencies.
Additionally, communication between a plurality of clients and the plurality of peers in a peer-to-peer network may encounter different communication latencies, one to another. For example, requests received from the plurality of clients for accessing a particular resource may reach different peers at different times due to variations in communication latency between the clients and the peers.
Accordingly, there is a continuing need for mutual exclusion techniques for use in a dynamic peer-to-peer environment.